# -*- coding: utf-8 -*-
import logging
from odoo import models, fields, api, _

_logger = logging.getLogger(__name__)


class Picking(models.Model):
    _inherit = "stock.picking"

    mark_date = fields.Datetime(u'记账日期')


class Picking(models.Model):
    _inherit = "sale.order"

    @api.multi
    def action_confirm(self):
        super(Picking, self).action_confirm()
        sp = self.env['stock.picking'].search([('sale_id','=',self.id)])
        self.env['stock.picking'].browse({})
        for rcd in self:
            for rcd in self:
                rcd.effective_date=fields.Datetime.now()
                sp.write({
                    'mark_date':rcd.effective_date
                })
        return


